﻿/*
 * by Helloximo
 * Yahoo: nguagovt
 * Email: nguagovt@gmail.com
 * My site: http://www.Bay68.Com
 */

function tinmoi(json) {
for (var i = 0; i < 10; i++) { var entry = json.feed.entry[i]; var posttitle = entry.title.$t; var posturl; if (i == json.feed.entry.length) break; 
for (var k = 0; k < entry.link.length; k++) { if (entry.link[k].rel == 'alternate') { posturl = entry.link[k].href; break } } 	
if(i >= 0 && i <= 10 ){var li = '<li><a href="'+posturl+'" title="'+posttitle+'">'+posttitle+'</a></li>';} document.write(li); }}
document.write('');

var posttitle = new Array();
var getbai = 0;
var posturl = new Array();
function lienquan(json) {
for (var i = 0; i < json.feed.entry.length; i++) {var entry = json.feed.entry[i]; posttitle[getbai] = entry.title.$t;
for (var k = 0; k < entry.link.length; k++) {if (entry.link[k].rel == 'alternate') {posturl[getbai] = entry.link[k].href; getbai++; break;}}}}
function xoatrunglap() { var bay = new Array(0); var bay2 = new Array(0);
for(var i=0; i < posturl.length; i++) {if(!contains(bay,posturl[i])){bay.length +=1;bay[bay.length -1] = posturl[i];bay2.length +=1;bay2[bay2.length -1] = posttitle[i];}}
posttitle = bay2;posturl = bay; }
function contains(a, e) {for(var j = 0; j < a.length; j++) if (a[j]==e) return true; return false;}
function nhanlienquan() {var r = Math.floor((posttitle.length - 1) * Math.random()); var i = 0;
document.write('<ul>');
while (i < posttitle.length && i < 10) {document.write('<li><a href="'+posturl[r]+'" title="'+posttitle[r]+'">'+posttitle[r]+'</a></li>');
if (r < posttitle.length - 1) {r++;} else {r = 0;} i++;}
document.write('</ul>');}